<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<script type="text/javascript" src="render/js/frontend/topNav.js"></script>

<div class="shop_hd">
    <!-- Header TopNav -->
    <div class="shop_hd_topNav">
        <div class="shop_hd_topNav_all">
            <!-- Header TopNav Left -->
            <div class="shop_hd_topNav_all_left">
                <p>您好，欢迎来到<b><a href="/">ShopCMJ商城</a></b>
                    <c:if test="${empty user }">
                        [<a href="/render/login">登录</a>][<a href="/render/register">注册</a>]
                    </c:if>

                    <c:if test="${!empty user }">
                        [<a href="render/myhome">欢迎你,<span style="color:#199805">${user.username}</span></a>]
<%--                        [<a href="/render/user/exit">退出</a>]--%>
                        [<a href="/logout">退出</a>]
                    </c:if>
                </p>
            </div>
            <!-- Header TopNav Left End -->

            <!-- Header TopNav Right -->
            <div class="shop_hd_topNav_all_right">
                <ul class="topNav_quick_menu">
                    <li>
                        <div class="topNav_menu">
                            <a href="javascript:void(0);" class="topNavHover">我的商城<i></i></a>
                            <div class="topNav_menu_bd" style="display:none;">
                                <ul>
<%--                                    <li><a title="已买到的商品" target="_top" href="javascript:void(0);">已买到的商品</a></li>--%>
                                    <li><a title="个人主页" target="_top" href="/render/myhome">个人主页</a></li>
                                    <li><a title="我的评价" target="_top" href="/render/comment">我的评价</a></li>
                                </ul>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="topNav_menu">
                            <a href="/render/myorder">
                                我的订单
                            </a>
                        </div>
                    </li>

                    <li>
                        <div class="topNav_menu">
                            <a href="/render/flow">
                                购物车
                            </a>
                        </div>
                    </li>

                    <li>
                        <div class="topNav_menu">
                            <a href="/render/favorite">
                                我的收藏
                            </a>
                        </div>
                    </li>

                    <%--<li>
                        <div class="topNav_menu">
                            <a href="javascript:void(0);">站内消息</a>
                        </div>
                    </li>--%>
                </ul>
            </div>
            <!-- Header TopNav Right End -->
        </div>
        <div class="clear"></div>
    </div>
    <div id="showDiv" style=" mfloat:left;left:610px;top:95px;display:none; position:absolute;z-index:1000;background:#fff; width:404px;border:1px solid #ccc;">
    </div>
    <div class="clear"></div>
</div>
<script type="text/javascript">
    function userExit(url) {
        $.ajax({
            url : url,
            type : "post",
            success : function(data) {
                if (data.success) {
                    HFalert({title: data.message, type: 'success', confirmButtonText: '确定'});
                    window.location.href = '/';
                } else {
                    HFalert({title: data.message, type: 'warning', confirmButtonText: '确定'});
                }
            }
        });
    }
</script>
